import request from '@/utils/request'

//统一字典下拉框查询
export function adminDict(params) {
  return request({
    url: `common/v1/adminDict`,
    method: 'get',
    params
  })
}

// 查询商家数字权益卡发行列表
export function getList(query) {
  return request({
    url: '/merchant/equity/card/issue/list',
    method: 'get',
    params: query
  })
}
//查询用户区域下拉框
export function areaList() {
    return request({
      url: '/common/v1/user/area/select',
      method: 'get',
    })
}

// 查询神椰行业下拉框
export function industrySelect() {
    return request({
      url: '/common/v1/industry/select',
      method: 'get',
    })
}

// 查询商家申请列表统计
export function getNumber(params) {
  return request({
    url: '/merchant/equity/card/apply/number',
    method: 'get',
    params: params,
  })
}
//编辑商家卡详情
export function editIssue(data) {
    return request({
      url: '/merchant/equity/card/issue/update',
      method: 'put',
      data
    })
  }

//查询商家权益卡店铺下拉框
export function shopSelect() {
    return request({
      url: '/common/v1/merchant/equity/card/shop/select',
      method: 'get',
    })
}

//查询连锁店铺下拉框
export function chainSelect(chainId) {
    return request({
      url: `/common/v1/chain/shop/select/${chainId}`,
      method: 'get',
    })
}

// 导出会员列表
export function exportCustomer(query) {
  return request({
    url: '/userManager/customer/export',
    method: 'get',
    params: query
  })
}
//查询商家申请详情
export function issueDetail(id) {
  return request({
    url: '/merchant/equity/card/issue/detail/'+id,
    method: 'get',
  })
}

// 获取权益卡详情
export function customerCardDetail(id) {
  return request({
    url: '/userManager/customer/equity/card/detail/' + id,
    method: 'get'
  })
}

//持卡会员统计
export function customerCount(params) {
    return request({
      url: '/merchant/equity/card/issue/customer/count',
      method: 'get',
      params
    })
}

//持卡会员列表
export function customerList(params) {
    return request({
      url: '/merchant/equity/card/issue/customer/list',
      method: 'get',
      params
    })
}

//卡信息（持卡明细）
export function issueCardDetail(id) {
    return request({
      url: '/merchant/equity/card/issue/customer/card/' + id,
      method: 'get'
    })
  }

//持卡明细
export function issueList(params) {
    return request({
      url: '/merchant/equity/card/issue/customer/card/list',
      method: 'get',
      params
    })
}
//订单列表
export function issueOrderList(data) {
    return request({
      url: '/merchant/equity/card/issue/order/list',
      method: 'post',
      data
    })
}

